Oracle 用户权限管理方法
二、登陆
sys;//系统管理员,拥有最高权限
/*oralce对权限管理比较严谨,普通用户之间也是默认不能互相访问的*/
select * from user_tab_privs;//查看所用用户对表的权限
八、权限传递
grante drop table to zhangsan;//授予删除表的权限
grant update(id) on tablename to zhangsan;//授予对指定表特定字段的插入和修改权限,注意,只能是insert和update
grant update on tablename to zhangsan;//授予修改表的权限
即用户A将权限授予B,B可以将操作的权限再授予C,命令如下:
select * from user_tab_privs;//查看所用用户对表的权限
sqlplus / as sysdba;//登陆sys帐户
1、默认的普通用户scott默认未解锁,不能进行那个使用,新建的用户也没有任何权限,必须授予权限
select * from user_sys_privs;//查看当前用户所有权限
scott;//普通用户,密码默认为tiger,默认未解锁
grant update on tablename to zhangsan;//授予修改表的权限
2、oralce对权限管理比较严谨,普通用户之间也是默认不能互相访问的,需要互相授权
sqlplus / as sysdba;//登陆sys帐户
system;//本地管理员,次高权限
grant drop on tablename to zhangsan;//授予删除表的权限
grant update(id) on tablename to zhangsan;//授予对指定表特定字段的插入和修改权限,注意,只能是insert和update
grant myrole to zhangsan;//授予zhangsan用户myrole的角色
grant insert(id) on tablename to zhangsan;
grant create session to myrole;//将创建session的权限授予myrole
grant create session to zhangsan;//授予zhangsan用户创建session的权限,即登陆权限
create user zhangsan;//在管理员帐户下,创建用户zhangsan
grant update table to zhangsan;//修改表的权限
九、角色
角色即权限的集合,可以把一个角色授予给用户
sqlplus scott/tiger;//登陆普通用户scott
五、撤销权限
grant select on tablename to zhangsan;//授予zhangsan用户查看指定表的权限
/*但是有些权限是不能授予给角色的,比如unlimited tablespace和any关键字*/ grant insert on tablename to zhangsan;//授予插入的权限
create user zhangsan;//在管理员帐户下,创建用户zhangsan
select * from user_sys_privs;//查看当前用户所有权限
基本语法同grant,关键字为revoke
四,授予权限
三、管理用户
grant alert table on tablename to zhangsan with grant option;//关键字 with grant option效果和admin类似
grant insert on tablename to zhangsan;//授予插入的权限
grant create table to zhangsan;//授予创建表的权限
grant alert table on tablename to zhangsan with grant option;//关键字 with grant option效果和admin类似
grant drop on tablename to zhangsan;//授予删除表的权限
drop role myrole;删除角色
grant alert all table to zhangsan;//授予zhangsan用户alert任意表的权限
grant alert table on tablename to zhangsan with admin option;//关键字 with admin option
sqlplus sys as sysdba;//同上
grant insert table to zhangsan;//插入表的权限
七、操作表的用户的表
grant unlimited session to zhangsan;//授予zhangsan用户使用表空间的权限
alert user scott identified by tiger;//修改密码
sqlplus scott/tiger;//登陆普通用户scott
sys;//系统管理员,拥有最高权限
create role myrole;//创建角色
grant insert(id) on tablename to zhangsan;
scott;//普通用户,密码默认为tiger,默认未解锁
grant insert table to zhangsan;//插入表的权限
grant update table to zhangsan;//修改表的权限
select * from zhangsan.tablename
grant all to public;//这条比较重要,授予所有权限(all)给所有用户(public)
grant alert all table to zhangsan;//授予zhangsan用户alert任意表的权限
grant create session to zhangsan;//授予zhangsan用户创建session的权限,即登陆权限
sqlplus sys as sysdba;//同上
alert user scott identified by tiger;//修改密码
select * from zhangsan.tablename
grant all to public;//这条比较重要,授予所有权限(all)给所有用户(public)
基本语法同grant,关键字为revoke
system;//本地管理员,次高权限
grant unlimited session to zhangsan;//授予zhangsan用户使用表空间的权限
grant select on tablename to zhangsan;//授予zhangsan用户查看指定表的权限
/*需要在表名前加上用户名,如下*/
/*需要在表名前加上用户名,如下*/
/*oralce对权限管理比较严谨,普通用户之间也是默认不能互相访问的*/
grant alert table on tablename to zhangsan with admin option;//关键字 with admin option
六、查看权限
/*管理员授权*/
/*管理员授权*/
grant create table to zhangsan;//授予创建表的权限
grante drop table to zhangsan;//授予删除表的权限
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://v30.fanwenzhu.com/sql/oracle/2920.shtml
相关文章
热门TAG
win10 ecshop 主机 阿里云 解决 配置 C# C++ 解析 SQL语句 命令 Go语言 方法 CSS3 HTML5 CSS win7 MSSQL 服务器配置 IIS7.5 IIS7 IIS6 IIS CentOS 7 Linux oracle数据库 oracle phpcms discuz discuz教程最新文章
-
是因为scan的IP问题补占用
时间:2021-01-20
-
还你一个干净的model 2、功
时间:2021-01-20
-
既然 ROWNUM 列并不是真实存
时间:2021-01-20
-
Real Application Clusters
时间:2021-01-20
-
在tools-preferences-connection(
时间:2021-01-20
-
Windows Sever 2012下Oracle 12c安
时间:2021-01-10
-
Oracle安装监听器错误的解
时间:2021-01-07
-
oracle远程连接服务器数据
时间:2021-01-07
热门文章
-
Oracle存储过程编程详解
时间:2020-12-07
-
Azure Queue Storage 基本用法 Azure Storage 之
时间:2020-12-26
-
win10下oracle 11g安装图文教程
时间:2020-12-25
-
oracle 数据库学习 基本结构介绍
时间:2020-12-13
-
Azure File Storage 基本用法 Azure Storage 之 F
时间:2020-12-26
-
windows使用sqlpus连接oracle 数据库的教程图
时间:2020-12-25
-
Window下Oracle Database 11g 发行版2安装教程
时间:2020-12-29
-
Oracle解锁的方式介绍
时间:2020-12-14
-
Oracle 12c Study之Installer Oracle
时间:2021-01-06
-
linux下oracle设置开机自启动实现方法
时间:2020-12-13
